export interface IProps {
  global: any;
  buttonPermissions: any;
  contractManagement: any;
  menuCode: string;
}

export interface IOptionType {
  label?: string;
  value?: string | number;
  children?: IOptionType[];
}

export interface IOrginDealElementOptions {
  id?: number;
  label?: string;
  value?: string;
  value2?: string;
  children?: IOrginDealElementOptions[];
}

export interface IDealElementOptions {
  id?: number;
  key?: string;
  label?: string;
  parentKey?: number;
  regionId?: string;
  title: string;
  value?: string;
  children?: IDealElementOptions[];
}

export type IDealElementDataObj = Record<number, IDealElementOptions[]>;

export interface ISearchFormData {
  dealElementOptions: IDealElementOptions[];
  dealElementModalOptions: IDealElementOptions[];
  dealElementDataObj: IDealElementDataObj;
  originDealElementOptions: IOrginDealElementOptions[];
}

export interface IInitFromValue {
  userTypeList?: string[]; // 用户类型集合
  beginDate?: string; //开始日期
  endDate?: string; //结束日期
  stationIdList?: string[]; //交易单元Id集合
  provinceId?: string; //单选省份id
  contractTypeCodes?: string[]; //合约类型code
  contractSourceList?: IContractSourceType; //合约来源;
  keyWords?: string; // 关键词
}

export interface ISearchValue extends IInitFromValue {
  tradeRoleList?: ITradeDirectionType[]; //交易方向
  storageCapacityCalcList?: IPositionsCalculateType[]; // 仓位计算
}

export interface IPageInfoType {
  currentPage: number;
  size: number;
  page: number;
  total: number;
}

export interface IRadioGroupOptionType extends IOptionType {
  color?: string;
  backgroundColor?: string;
  defaultColor?: string;
  defaultBackgroundColor?: string;
}

export interface IFileAnalysisResult {
  isUseTemplate?: boolean; //文件是否是使用模版文件
  isLargeFile?: boolean; // 是否大于5000行
  isEmpty?: boolean; // 文件是否为空
  isQualified: boolean; //文件是否合格
  isNumber?: boolean; //文件是否不为数字
  fileType?: ITemplateType; // 文件类型
  data?: any[]; // 文件数据
  totalAmount?: number; // 总电量
  totalCost?: number; // 总电费
  arrayTd?: [string]; // 表头
}

export interface IListType {
  idx: string;
  father: boolean;
  contractId?: string; //合同编码/id
  stationName?: string; //交易单元name
  stationId?: string; //交易单元id
  tradeRole?: ITradeDirectionType; //交易方向
  contractName?: string; //合约名称
  contractType?: string; //合约类型
  contractStartDate?: string; //合约开始日期
  contractEndDate?: string; //合约结束日期
  totalToBeExecutedContractQuantity?: string; //总待执行电量（MWh）
  totalToBeExecutedContractPrice?: string; //总待执行电价（元/MWh）
  totalToBeExecutedContractIncome?: string; //总待执行电费（元）
  totalContractPrice?: string; //总合同电价（元/MWh）
  totalContractQuantity?: string; //总合同电量（MWh）
  totalContractIncome?: string; //总合同电费（元）
  isVirtual?: string; //是否虚拟合同 1-是 0-否
  parentContractId?: string; //父合同编码/id
  storageCapacityCalc?: IPositionsCalculateType; //仓位计算（0：不参与、1：参与）
  contractSource?: IContractSourceType; //合同来源
  childrenContractList?: IListType[]; // 子合约
  children?: IListType[]; // 子合约
  type?: IContractType; //合约类型
  contractAndstationId?: string;
  date?: string;
  tag?: string;
  id?: number | string;
  statisticsPower?: string;
}

export interface IPriceFluctuationType {
  income?: number;
  price?: number;
  quantity?: number;
  timeOrder?: number;
}

export interface ITradeType {
  codeId?: string;
  codeName?: string;
  tradeTypeChildren?: ITradeType[];
}

// 交易方向
export enum ITradeDirectionType {
  ALL_DIRECTION = '3', // 全部方向
  BUY = '1', // 买入
  SELL = '2', // 卖出
}

// 合约来源
export enum IContractSourceType {
  ALL_TYPE = '4', // 全部来源
  TRADING_CENTER = '3', // 交易中心
  TRADING_CENTER_NOMAL = '0', // 交易中心-常规合约
  TRADING_CENTER_VIRTUAL = '1', // 交易中心-虚拟合约
  USER_UPLOAD = '2', // 用户上传
}

//仓位计算
export enum IPositionsCalculateType {
  ALL_TYPE = '3', // 全部类型
  TAKE_PART_IN = '1', // 参与
  DROP_OUT = '0', // 不参与
}

// 操作类型
export enum IOperationType {
  DETAIL = '1', //详情
  EDIT = '2', // 编辑
  DETELE = '3', // 删除
  EXPORT = '4', // 删除
}

// 请求接口状态
export enum IRequireType {
  SUCCES = '1', // 成功
  FAIL = '2', //失败
}

export enum IPickerType {
  DATE = 'date', // 日期
  MONTH = 'month', //月份
}

export enum IPointerType {
  NINETY_SIX_POINT = 96, //96点
  TWENTY_FOUR_POINT = 24, //24点
}

export enum IDrawerType {
  ADD = 'add', // 新增
  EDIT = 'edit', //编辑
  DETAIL = 'detail', //详情
}

export enum ITemplateType {
  DAYTIME_SAME_CURVE_NINETY_SIX_POINT = '1', //日间同曲线-96点模板
  DAYTIME_SAME_CURVE_TWENTY_FOUR_POINT = '2', //日间同曲线-24点模板
  DIURNAL_NINETY_SIX_POINT = '3', //日间分曲线-96点模板
  DIURNAL_TWENTY_FOUR_POINT = '4', //日间分曲线-24点模板
}

export enum IModalType {
  CONFIRM = 'confirm', // 只有确认按钮
  MODAL = 'modal', // 同时具有取消和确认按钮
  INFO = 'info', // 没有按钮
}

export enum IContractType {
  MAINCONTRACT = '1', // 主合约
  SUBCONTRACT = '2', // 辅助合约
}

export enum IContractPermissions {
  CONTRACTMANAGEMENTEXPORTBUTTON = 'ContractManagementExportButton', // 合约管理导出按钮
  CONTRACTMANAGEMENTADDBUTTON = 'ContractManagementAddButton', // 合约管理新增按钮
  CONTRACTMANAGEMENTEDITBUTTON = 'ContractManagementEditButton', // 合约管理编辑按钮
  CONTRACTMANAGEMENTDELBUTTON = 'ContractManagementDelButton', // 合约管理删除按钮
  CONTRACTMANAGEMENTBATCHDELBUTTON = 'ContractManagementBatchDelButton', // 合约管理批量删除按钮
  CONTRACTMANAGEMENTANALYSISBUTTON = 'ContractManagementAnalysisButton', // 合约管理合约分析按钮
}

export enum IDataTabeType {
  QUANTITY = '电量',
  PRICE = '电价',
}
